package com.surprise.biz;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;

import com.surprise.db.DbBeanConfig;
import com.surprise.es.ESBeanConfig;
import com.surprise.ods.OdsBeanConfig;
import com.surprise.redis.RedisBeanConfig;

/**
 * ServiceBeanConfig.java
 * @author nick
 * 2015年2月4日
 */
@Configuration
@ComponentScan(basePackages = "com.surprise.biz",
        excludeFilters = @Filter(type = FilterType.REGEX, pattern = {
                "com.surprise.biz.util", "com.surprise.biz.po",
                "com.surprise.biz.bo" }))
@Import({OdsBeanConfig.class, DbBeanConfig.class, RedisBeanConfig.class, ESBeanConfig.class})
@PropertySource({"classpath:/common-biz.properties"})
public class BizBeanConfig {
    @Bean
    public static PropertySourcesPlaceholderConfigurer propertyConfigurer3() {
        PropertySourcesPlaceholderConfigurer order = new PropertySourcesPlaceholderConfigurer();
        order.setOrder(3);
        order.setIgnoreUnresolvablePlaceholders(true);
        return order;
    }
}
